import requests

BASE_URL = "http://localhost:8080/api/auth"

def register(username, password, email):
    url = f"{BASE_URL}/register"
    params = {
        "username": username,
        "password": password,
        "email": email
    }
    response = requests.post(url, params=params)
    return response.json()

def login(username, password):
    url = f"{BASE_URL}/login"
    params = {
        "username": username,
        "password": password
    }
    response = requests.post(url, params=params)
    return response.json()

if __name__ == "__main__":
    # Test the register function
    print("Registering user...")
    register_response = register("ssss", "Test12www35", "testuser@example.com")
    print("Register Response:", register_response)

    # Test the login function
#     print("Logging in user...")
#     login_response = login("Blume2", "Test12345")
#     print("Login Response:", login_response)